/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.system.domain;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Date;

@ApiModel(value = "用户登录日志", description = "登录日志实体类")
public class OnlineLog implements Serializable {

    private static final long serialVersionUID = 4042387387219324867L;

    @ApiModelProperty(value = "用户会话id", name = "sessionId", required = true)
    private String sessionId;

    @ApiModelProperty(value = "部门名称", name = "deptName" )
    private String deptName;

    @ApiModelProperty(value = "登录名称", name = "loginName", required = true)
    private String loginName;

    @ApiModelProperty(value = "登录IP地址", name = "ipaddr", required = true)
    private String ipaddr;

    @ApiModelProperty(value = "登录地址", name = "loginLocation", required = true)
    private String loginLocation;

    @ApiModelProperty(value = "浏览器", name = "browser", required = true)
    private String browser;

    @ApiModelProperty(value = "操作系统", name = "os", required = true)
    private String os;

    @ApiModelProperty(value = "session创建时间", name = "startTimestamp", required = true)
    private Date startTimestamp;

    @ApiModelProperty(value = "session最后访问时间", name = "lastAccessTime", required = true)
    private Date lastAccessTime;

    @ApiModelProperty(value = "超时时间，单位为分钟", name = "expireTime", required = true)
    private Long expireTime;

    @ApiModelProperty(value = "在线状态: 0离线 1在线", name = "status", required = true)
    private Integer status;

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getIpaddr() {
        return ipaddr;
    }

    public void setIpaddr(String ipaddr) {
        this.ipaddr = ipaddr;
    }

    public String getLoginLocation() {
        return loginLocation;
    }

    public void setLoginLocation(String loginLocation) {
        this.loginLocation = loginLocation;
    }

    public String getBrowser() {
        return browser;
    }

    public void setBrowser(String browser) {
        this.browser = browser;
    }

    public String getOs() {
        return os;
    }

    public void setOs(String os) {
        this.os = os;
    }

    public Date getStartTimestamp() {
        return startTimestamp;
    }

    public void setStartTimestamp(Date startTimestamp) {
        this.startTimestamp = startTimestamp;
    }

    public Date getLastAccessTime() {
        return lastAccessTime;
    }

    public void setLastAccessTime(Date lastAccessTime) {
        this.lastAccessTime = lastAccessTime;
    }

    public Long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Long expireTime) {
        this.expireTime = expireTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("sessionId", getSessionId())
                .append("loginName", getLoginName())
                .append("deptName", getDeptName())
                .append("ipaddr", getIpaddr())
                .append("loginLocation", getLoginLocation())
                .append("browser", getBrowser())
                .append("os", getOs())
                .append("status", getStatus())
                .append("startTimestamp", getStartTimestamp())
                .append("lastAccessTime", getLastAccessTime())
                .append("expireTime", getExpireTime())
                .toString();
    }

}
